﻿using StarLabel.label;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;

namespace StarLableSample
{
    class Program
    {
        static void Main(string[] args)
        {


            printPlugin();
        }
        static void printPlugin()
        {
            string template = AppDomain.CurrentDomain.BaseDirectory + "templates\\插件.tl";

            List<Hashtable> dataList = new List<Hashtable>();

            Hashtable ht = new Hashtable();
            ht.Add("Code", "ABC-001");
             

            dataList.Add(ht);

            StarLabelPrint.RegisterItem("ReverseItem", "MyLabelPlugin.dll,MyLabelPlugin.ReverseItem");
            StarLabelPrint.printData(dataList, "printer name", template, PrintParam.DefaultPrintParam());
        }
        static void printLabel()
        {
            string template = AppDomain.CurrentDomain.BaseDirectory+ "templates\\常规.tl";
            
            List<Hashtable> dataList = new List<Hashtable>();

            Hashtable ht = new Hashtable();
            ht.Add("Code", "ABC-001");
            ht.Add("Title", "测试StarLabel");

            dataList.Add(ht);

            StarLabelPrint.printData(dataList, "printer name",template, PrintParam.DefaultPrintParam());
        
        }
    }
}
